package com.gavindon.android.repo

import com.gavindon.android.base.BaseRepository
import com.gavindon.android.entity.HomeBannerResp
import com.gavindon.android.entity.RecommendLstResp
import com.gavindon.android.entity.ScanCodeResp
import com.gavindon.android.entity.UserInfoResp
import com.gavindon.android.network.DataResult

/**
 * description:
 * Created by liNan on  2022-2-5 13:47
 */
class HomeRepo : BaseRepository() {


    suspend fun recommendList(): DataResult<List<RecommendLstResp>> {
        return launchRequest {
            service.recommendList()
        }
    }

    suspend fun newestList(): DataResult<List<RecommendLstResp>> {
        return launchRequest {
            service.newestList()
        }
    }

    suspend fun sliderBanner(): DataResult<List<HomeBannerResp>> {
        return launchRequest {
            service.sliderBanner()
        }
    }

    suspend fun scanCode(): DataResult<ScanCodeResp> {
        return launchRequest {
            service.scanCode()
        }
    }

    suspend fun userLogin(content: String): DataResult<ScanCodeResp> {
        return launchRequest {
            service.userLogin(content)
        }
    }

    suspend fun userLoginInfo(): DataResult<UserInfoResp> {
        return launchRequest {
            service.loginUserInfo()
        }
    }
}